<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Member
 *
 * @author Zoila
 */
class ProjectMember extends AppModel{
    //put your code here
     var $validate = array(
        
       'user_id' => array( 'required'=> array(
                                'rule' => array('notEmpty')
                            )
                    ),
         'project_id' => array( 'required'=> array(
                                'rule' => array('notEmpty')
                            )
                    )
         );
     
    public $belongsTo = array(
        'Project' => array(
            'className'    => 'Project',
            'foreignKey'   => 'project_id'
        ), 
        'User' => array(
            'className'    => 'User',
            'foreignKey'   => 'user_id',
            'order'      => 'User.username DESC'
        ),

        'Role' => array(
            'className'    => 'Role',
            'foreignKey'   => 'role_id'
        )
   );
    
 
}

?>
